package com.san.dissertation.dao.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.san.dissertation.bpm.model.ProcessInstance;
import com.san.dissertation.bpm.model.ProcessPath;
import com.san.dissertation.dao.repository.ProcessInstanceRepository;
import com.san.dissertation.dao.repository.ProcessPathRepository;
import com.san.dissertation.dao.repository.ProcessRepository;
import com.san.dissertation.bpm.model.Process;

public class DAOServiceImpl {

	@Autowired
	private ProcessPathRepository processPathRepository;
	@Autowired
	private ProcessInstanceRepository processInstanceRepository;
	@Autowired
	private ProcessRepository processRepository;

	public ProcessPathRepository getProcessPathRepository() {
		return processPathRepository;
	}

	public void setProcessPathRepository(
			ProcessPathRepository processPathRepository) {
		this.processPathRepository = processPathRepository;
	}

	public ProcessInstanceRepository getProcessInstanceRepository() {
		return processInstanceRepository;
	}

	public void setProcessInstanceRepository(
			ProcessInstanceRepository processInstanceRepository) {
		this.processInstanceRepository = processInstanceRepository;
	}

	
	public ProcessRepository getProcessRepository() {
		return processRepository;
	}

	public void setProcessRepository(ProcessRepository processRepository) {
		this.processRepository = processRepository;
	}

	public void saveProcessPath(List<ProcessPath> processPath) {

		for (ProcessPath path : processPath) {
			processPathRepository.save(path);
		}
	}

	public void createInstance(ProcessInstance instance) {

		processInstanceRepository.save(instance);

	}
	
	
	


}
